package com.woniuxy.joylifeshop.service.serviceImpl;

import com.woniuxy.common.entity.CenterUser;
import com.woniuxy.common.mapper.CenterUserMapper;
import com.woniuxy.joylifeshop.exception.UserException;
import com.woniuxy.joylifeshop.service.CenterUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CenterUserServletImpl implements CenterUserService {

    @Autowired
    CenterUserMapper centerUserMapper;

    /**
    * @Author SooYoo
    * @Description 通过用户id找到用户对象
    * @Param 
    * @Return 
    **/
    @Override
    public CenterUser readUserByUserId(String userId) {

        try {
            CenterUser centerUser = centerUserMapper.selectByPrimaryKey(userId);

            return centerUser;
        } catch (Exception e) {
            e.printStackTrace();
            throw new UserException();
        }
    }
}
